package com.zf.zffencheng.conf;

import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
 * ClassName: RedissonConfig <br/>
 * Description:  <br/>
 * date: 2021/5/7 10:07<br/>
 *
 * @author william <br/>
 */
@Configuration
public class RedissonConfig {
    @Value("${redis.url}")
    private String redisUrl;
    @Value("${redis.password}")
    private String redisPassword;
    @Bean
    public RedissonClient redissonClient() {
        Config config = new Config();
        config.useSingleServer().setAddress(redisUrl).setPassword(redisPassword);
        return Redisson.create(config);
    }
}
